package oop01;

/**
 * @author Mark
 * @version 1.0
 * @date 2020/5/16 19:31
 * @description 对象测试
 */
public class AppTest {
    public static void main(String[] args) {

        // 用户类调用 static关键字是和类一起加载的(比类早)
        User user = new User();
        user.say();

        int a = 1;
        System.out.println(a);

        // 1值传递
        change(a);
        System.out.println(a);

        // 引用传递
        change(user);
        System.out.println(user.name);

    }

    private static void change(int a) {
        a = 10;
    }

    private static void change(User user) {
        user.name = "是我";
    }

}
